<?php

/*

  Action	$4

  +$2
  If you've played 3 or more Actions this turn (counting this): +1 Card; +1 Action.

 */

class Conspirator extends Card implements iAction, iKingdom, iIntrigue {

    public function __construct() {
        parent::__construct("Conspirator", 4);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+$2",
            "If you have played 3 or more Actions this turn (counting this): +1 Card; +1 Action.");
    }
    
    public function play(Game $game, $isRealCard) {
        $game->addMoney(new Price(2));
         ScreenDisplay::addScreenMessage($game, true, "get +2$", "gets +2$");
        $numberOfActionsPlayed = $game->getNumberOfActionsPlayed();
        if ($numberOfActionsPlayed >= 3) {
            $game->addActions(1);
            $drawed_cards = $game->drawCards(1);
             ScreenDisplay::addScreenMessage($game, false, ", +1 action and draw ".  nicePrint($drawed_cards), ", +1 action and draws ".sizeof($drawed_cards). " cards");
        }
		$game->cardActionFinished();
        return true;
    }

}

?>